package com.nulldev.util.concurrency.threadIt.v4.executors.bqde;

import com.nulldev.util.internal.backport.concurrency9.concurrent.CompletableFuture;

final class BQDEUtils {

	static void __handle_exception(final Object r, final Throwable e) {
		if (r instanceof CompletableFuture || r instanceof java.util.concurrent.CompletableFuture) {
			if (r instanceof CompletableFuture) {
				((CompletableFuture<?>) r).completeExceptionally(e);
			} else if (r instanceof java.util.concurrent.CompletableFuture) {
				((java.util.concurrent.CompletableFuture<?>) r).completeExceptionally(e);
			}

			return;
		}

		if (!(e instanceof InterruptedException)) {
			e.printStackTrace();
		}
	}
}
